<template>
  <div class="overlay">
    <!-- <van-overlay :show="show2" @click="show2 = false"> -->
    <div class="wrapper" v-if="sureShow == 0">
      <div class="block" @click.stop>
        <h3>修改名称</h3>
        <p>请给收藏夹取一个好听的名字吧</p>
        <input type="text" placeholder="请输入内容" />
        <div class="btn">
          <button @click="unsureAction">取消</button>
          <button class="btn2" @click="sureAction">确定</button>
        </div>
      </div>
    </div>

    <div class="wrapper" v-if="sureShow == 1">
      <div class="block" @click.stop>
        <h3>删除提示</h3>
        <p>确定删除文件夹所有收藏的菜谱？</p>
        <p>删除后将无法恢复。</p>
        <div class="btn">
          <button @click="unsureAction">取消</button>
          <button class="btn2" @click="sureAction">确定</button>
        </div>
      </div>
    </div>
    <!-- </van-overlay> -->
  </div>
</template>

<script>
import { Toast } from "vant";
export default {
  props: {
    sureShow: {
      type: Number,
      required: true,
    },
  },
  data() {
    return {
      show2: true,
    };
  },
  methods: {
    sureAction() {
      console.log("确定");
      Toast({
        message: "操作成功",
        icon: "success",
      });
      this.$emit("change", false);
    },
    unsureAction() {
      console.log("取消");
      this.$emit("change", false);
    },
  },
};
</script>

<style scoped lang="scss">
.overlay {
  width: 100%;
  height: 100%;
  background-color: rgba(40, 44, 41, 0.296);
  position: absolute;
  top: 0;
  left: 0;
  .wrapper {
    width: 220px;
    height: 200px;
    display: flex;
    margin: auto;
    align-items: center;
    justify-content: center;
    transform: translateY(100%);
    background-color: #fff;
    border-radius: 10px;
  }
  .block {
    width: 260px;
    height: 200px;
    background-color: #fff;
    border-radius: 10px;
    text-align: center;
    position: relative;
    h3 {
      font-weight: 700;
      line-height: 50px;
    }
    p {
      line-height: 30px;
      font-size: 14px;
      color: #6d6a6a;
    }
    input {
      height: 35px;
      border: 1px solid #ccc;
      padding: 0 10px;
      border-radius: 5px;
      margin-top: 10px;
      &::placeholder {
        color: #ccc;
        font-size: 14px;
      }
    }
    .btn {
      width: 100%;
      position: absolute;
      bottom: 0;
      left: 0;
      button {
        width: 50%;
        height: 50px;
        background-color: #fff;
        border: 1px solid #ccc;
        border-left: none;
        border-bottom: none;
        color: #ccc;
        border-radius: 0 0 0 5px;
        &:last-child {
          color: blue;
          border-left: none;
          border-radius: 0 0 5px 0;
          border-right: none;
        }
      }
    }
  }
}
</style>
